import request from "../utils/adminRequest";

//职位审核查询
export const getAllPosReviewApi = (currentPage, pageSize) => request.get(`/admin/positions/review?currentPage=${currentPage}&pageSize=${pageSize}`)

//通过职位id查询职位详情
export const getPosByIdApi = (id) => request.get(`/admin/positions/${id}`)

//职位审核通过
export const passReviewApi = (ids) => request.put(`/admin/positions`, ids)

//职位审核不通过
export const noPassReviewApi = (id, message) => request.put(`/admin/positions/${id}/${message}`)

//职位列表查询
export const getAllPosApi = (title, positionType, publishDate, currentPage, pageSize) => {
  return request.get(`/admin/positions?title=${title}&positionType=${positionType}&publishDate=${publishDate}&currentPage=${currentPage}&pageSize=${pageSize}`)
}

//查询用户列表
export const getAllUserApi = (phone, userType, createTime, currentPage, pageSize) => {
  return request.get(`/admin/users?phone=${phone}&userType=${userType}&createTime=${createTime}&currentPage=${currentPage}&pageSize=${pageSize}`)
}

//启用禁用用户
export const startOrStopApi = (status, id) => request.put(`/admin/users/${status}?id=${id}`)

// 统计不同用户数量
export const reportUserCountApi = () => request.get(`/admin/reports/userCount`)

// 统计某一年的职位发布情况
export const reportPositionCountApi = () => request.get(`/admin/reports/positionCount`)
//企业列表查询
export const getAllCompanyApi = (name,description,companyScale,currentPage, pageSize) => request.get(`/admin/companies/all?name=${name}&description=${description}&companyScale=${companyScale}&currentPage=${currentPage}&pageSize=${pageSize}`)